package com.barbeque.mall.exception;

import com.barbeque.mall.bean.BaseRespVoNoData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Tezel
 * @since 2022/07/21 21:53
 */
@RestControllerAdvice
public class ProductNumberExceptionControllerAdvice {

    @ExceptionHandler(ProductNumberException.class)
    public BaseRespVoNoData invalidFormatException(ProductNumberException e) {
        e.printStackTrace();
        return BaseRespVoNoData.error(500, "库存不足");
    }
}
